#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Time       :   11:41
# Author     : Y4
# Site       : 验证
# File       : valify.py

# 验证手机号
import re


def check_phone(phone: str):
    # 判断手机号长度
    if len(str(phone)) == 11:
        # 从头匹配手机号
        re_phone = re.match(r'^1[3-9][0-9]{9}$', phone)
        if re_phone is None:
            return None
        else:
            phone = re_phone.group()
            return phone
    else:
        return None